package com.onLineCar.netty.eunm;

import com.onLineCar.netty.protocol.command.*;
import lombok.*;

/**
 * @program: OnLineCar
 * @description:
 * @author: godGuang
 * @create: 2023-12-23 09:29
 **/
@NoArgsConstructor
@AllArgsConstructor
public enum TypeEnum {
    REGISTER(7, "注册user"),
    SINGLE_CHAT(1, "单聊"),
    CREATE_GROUP(3, "创建群聊"),
    MAP_LOCATION(5, "地圖經緯度"),
    GROUP_CHAT(9, "群聊消息"),
    HEARTBEAT(11, "心跳检测");

    private int type;
    private String typeName;

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public static TypeEnum get(int type) {
        for (TypeEnum value : TypeEnum.values()) {
            if (value.getType() == type) {
                return value;
            }
        }
        return null;
    }


}




